3.116 \(\int \frac{x^2 (c+d x^2+e x^4+f x^6)}{a+b x^2} \, dx\)

Optimal. Leaf size=136 \[ \frac{x \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{b^4}-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{b^{9/2}}+\frac{x^3 \left (a^2 f-a b e+b^2 d\right )}{3 b^3}+\frac{x^5 (b e-a f)}{5 b^2}+\frac{f x^7}{7 b} \]

[Out]

((b^3*c - a*b^2*d + a^2*b*e - a^3*f)*x)/b^4 + ((b^2*d - a*b*e + a^2*f)*x^3)/(3*b^3) + ((b*e - a*f)*x^5)/(5*b^2
) + (f*x^7)/(7*b) - (Sqrt[a]*(b^3*c - a*b^2*d + a^2*b*e - a^3*f)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(9/2)

________________________________________________________________________________________

Rubi [A]  time = 0.105374, antiderivative size = 136, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {1802, 205} \[ \frac{x \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{b^4}-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{b^{9/2}}+\frac{x^3 \left (a^2 f-a b e+b^2 d\right )}{3 b^3}+\frac{x^5 (b e-a f)}{5 b^2}+\frac{f x^7}{7 b} \]

Antiderivative was successfully verified.

[In]

Int[(x^2*(c + d*x^2 + e*x^4 + f*x^6))/(a + b*x^2),x]

[Out]

((b^3*c - a*b^2*d + a^2*b*e - a^3*f)*x)/b^4 + ((b^2*d - a*b*e + a^2*f)*x^3)/(3*b^3) + ((b*e - a*f)*x^5)/(5*b^2
) + (f*x^7)/(7*b) - (Sqrt[a]*(b^3*c - a*b^2*d + a^2*b*e - a^3*f)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(9/2)

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{x^2 \left (c+d x^2+e x^4+f x^6\right )}{a+b x^2} \, dx &=\int \left (\frac{b^3 c-a b^2 d+a^2 b e-a^3 f}{b^4}+\frac{\left (b^2 d-a b e+a^2 f\right ) x^2}{b^3}+\frac{(b e-a f) x^4}{b^2}+\frac{f x^6}{b}+\frac{-a b^3 c+a^2 b^2 d-a^3 b e+a^4 f}{b^4 \left (a+b x^2\right )}\right ) \, dx\\ &=\frac{\left (b^3 c-a b^2 d+a^2 b e-a^3 f\right ) x}{b^4}+\frac{\left (b^2 d-a b e+a^2 f\right ) x^3}{3 b^3}+\frac{(b e-a f) x^5}{5 b^2}+\frac{f x^7}{7 b}-\frac{\left (a \left (b^3 c-a b^2 d+a^2 b e-a^3 f\right )\right ) \int \frac{1}{a+b x^2} \, dx}{b^4}\\ &=\frac{\left (b^3 c-a b^2 d+a^2 b e-a^3 f\right ) x}{b^4}+\frac{\left (b^2 d-a b e+a^2 f\right ) x^3}{3 b^3}+\frac{(b e-a f) x^5}{5 b^2}+\frac{f x^7}{7 b}-\frac{\sqrt{a} \left (b^3 c-a b^2 d+a^2 b e-a^3 f\right ) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{b^{9/2}}\\ \end{align*}

Mathematica [A]  time = 0.0885713, size = 128, normalized size = 0.94 \[ \frac{x \left (35 a^2 b \left (3 e+f x^2\right )-105 a^3 f-7 a b^2 \left (15 d+5 e x^2+3 f x^4\right )+b^3 \left (105 c+35 d x^2+21 e x^4+15 f x^6\right )\right )}{105 b^4}+\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (-a^2 b e+a^3 f+a b^2 d-b^3 c\right )}{b^{9/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(c + d*x^2 + e*x^4 + f*x^6))/(a + b*x^2),x]

[Out]

(x*(-105*a^3*f + 35*a^2*b*(3*e + f*x^2) - 7*a*b^2*(15*d + 5*e*x^2 + 3*f*x^4) + b^3*(105*c + 35*d*x^2 + 21*e*x^
4 + 15*f*x^6)))/(105*b^4) + (Sqrt[a]*(-(b^3*c) + a*b^2*d - a^2*b*e + a^3*f)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(9/
2)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 182, normalized size = 1.3 \begin{align*}{\frac{f{x}^{7}}{7\,b}}-{\frac{{x}^{5}af}{5\,{b}^{2}}}+{\frac{{x}^{5}e}{5\,b}}+{\frac{{x}^{3}{a}^{2}f}{3\,{b}^{3}}}-{\frac{a{x}^{3}e}{3\,{b}^{2}}}+{\frac{{x}^{3}d}{3\,b}}-{\frac{{a}^{3}fx}{{b}^{4}}}+{\frac{{a}^{2}ex}{{b}^{3}}}-{\frac{adx}{{b}^{2}}}+{\frac{cx}{b}}+{\frac{{a}^{4}f}{{b}^{4}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{{a}^{3}e}{{b}^{3}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{{a}^{2}d}{{b}^{2}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{ac}{b}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a),x)

[Out]

1/7*f*x^7/b-1/5/b^2*x^5*a*f+1/5/b*x^5*e+1/3/b^3*x^3*a^2*f-1/3/b^2*x^3*a*e+1/3/b*x^3*d-1/b^4*a^3*f*x+1/b^3*a^2*
e*x-1/b^2*a*d*x+1/b*c*x+a^4/b^4/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*f-a^3/b^3/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/
2))*e+a^2/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*d-a/b/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*c

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.56202, size = 606, normalized size = 4.46 \begin{align*} \left [\frac{30 \, b^{3} f x^{7} + 42 \,{\left (b^{3} e - a b^{2} f\right )} x^{5} + 70 \,{\left (b^{3} d - a b^{2} e + a^{2} b f\right )} x^{3} - 105 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} \sqrt{-\frac{a}{b}} \log \left (\frac{b x^{2} + 2 \, b x \sqrt{-\frac{a}{b}} - a}{b x^{2} + a}\right ) + 210 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} x}{210 \, b^{4}}, \frac{15 \, b^{3} f x^{7} + 21 \,{\left (b^{3} e - a b^{2} f\right )} x^{5} + 35 \,{\left (b^{3} d - a b^{2} e + a^{2} b f\right )} x^{3} - 105 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} \sqrt{\frac{a}{b}} \arctan \left (\frac{b x \sqrt{\frac{a}{b}}}{a}\right ) + 105 \,{\left (b^{3} c - a b^{2} d + a^{2} b e - a^{3} f\right )} x}{105 \, b^{4}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a),x, algorithm="fricas")

[Out]

[1/210*(30*b^3*f*x^7 + 42*(b^3*e - a*b^2*f)*x^5 + 70*(b^3*d - a*b^2*e + a^2*b*f)*x^3 - 105*(b^3*c - a*b^2*d +
a^2*b*e - a^3*f)*sqrt(-a/b)*log((b*x^2 + 2*b*x*sqrt(-a/b) - a)/(b*x^2 + a)) + 210*(b^3*c - a*b^2*d + a^2*b*e -
 a^3*f)*x)/b^4, 1/105*(15*b^3*f*x^7 + 21*(b^3*e - a*b^2*f)*x^5 + 35*(b^3*d - a*b^2*e + a^2*b*f)*x^3 - 105*(b^3
*c - a*b^2*d + a^2*b*e - a^3*f)*sqrt(a/b)*arctan(b*x*sqrt(a/b)/a) + 105*(b^3*c - a*b^2*d + a^2*b*e - a^3*f)*x)
/b^4]

________________________________________________________________________________________

Sympy [A]  time = 0.813254, size = 180, normalized size = 1.32 \begin{align*} - \frac{\sqrt{- \frac{a}{b^{9}}} \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right ) \log{\left (- b^{4} \sqrt{- \frac{a}{b^{9}}} + x \right )}}{2} + \frac{\sqrt{- \frac{a}{b^{9}}} \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right ) \log{\left (b^{4} \sqrt{- \frac{a}{b^{9}}} + x \right )}}{2} + \frac{f x^{7}}{7 b} - \frac{x^{5} \left (a f - b e\right )}{5 b^{2}} + \frac{x^{3} \left (a^{2} f - a b e + b^{2} d\right )}{3 b^{3}} - \frac{x \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right )}{b^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(f*x**6+e*x**4+d*x**2+c)/(b*x**2+a),x)

[Out]

-sqrt(-a/b**9)*(a**3*f - a**2*b*e + a*b**2*d - b**3*c)*log(-b**4*sqrt(-a/b**9) + x)/2 + sqrt(-a/b**9)*(a**3*f
- a**2*b*e + a*b**2*d - b**3*c)*log(b**4*sqrt(-a/b**9) + x)/2 + f*x**7/(7*b) - x**5*(a*f - b*e)/(5*b**2) + x**
3*(a**2*f - a*b*e + b**2*d)/(3*b**3) - x*(a**3*f - a**2*b*e + a*b**2*d - b**3*c)/b**4

________________________________________________________________________________________

Giac [A]  time = 1.16904, size = 205, normalized size = 1.51 \begin{align*} -\frac{{\left (a b^{3} c - a^{2} b^{2} d - a^{4} f + a^{3} b e\right )} \arctan \left (\frac{b x}{\sqrt{a b}}\right )}{\sqrt{a b} b^{4}} + \frac{15 \, b^{6} f x^{7} - 21 \, a b^{5} f x^{5} + 21 \, b^{6} x^{5} e + 35 \, b^{6} d x^{3} + 35 \, a^{2} b^{4} f x^{3} - 35 \, a b^{5} x^{3} e + 105 \, b^{6} c x - 105 \, a b^{5} d x - 105 \, a^{3} b^{3} f x + 105 \, a^{2} b^{4} x e}{105 \, b^{7}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a),x, algorithm="giac")

[Out]

-(a*b^3*c - a^2*b^2*d - a^4*f + a^3*b*e)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^4) + 1/105*(15*b^6*f*x^7 - 21*a*b^
5*f*x^5 + 21*b^6*x^5*e + 35*b^6*d*x^3 + 35*a^2*b^4*f*x^3 - 35*a*b^5*x^3*e + 105*b^6*c*x - 105*a*b^5*d*x - 105*
a^3*b^3*f*x + 105*a^2*b^4*x*e)/b^7